import JMessage from 'jmessage-react-plugin'

export default{
    // 初始化方法
    init(){
        JMessage.init({
            'appkey':'c375c6e61b8b2460d6000b2c',
            'isOpenMessageRoaming':false,
            'isProduction':false,
            'channel':''
          })
    },
    // 注册
    register(username,password){
        return new Promise((resolve,reject)=>{
            JMessage.register({
                username,
                password
            },resolve,reject)
        })
    },
    // 登录
    login(username,password){
        return new Promise((resolve,reject)=>{
            JMessage.login({
                username,
                password
            },resolve,reject)
        })
    }
}